package com.dnr.arch.kernel.services.persistence.util;

import java.lang.reflect.Field;

public class PersistenceUtility {

	public static final String MAX_CARDINALITY = "max";
	
	public static boolean isRelationAnnotated(Field f){
		boolean test = false;
		test |= f.getAnnotation(javax.persistence.ManyToOne.class)!=null;
		test |= f.getAnnotation(javax.persistence.OneToMany.class)!=null;
		return test;
	}
	
	public static boolean isFieldAnnotated(Field f){
		boolean test = false;
		test |= f.getAnnotation(javax.persistence.ManyToOne.class)!=null;
		test |= f.getAnnotation(javax.persistence.OneToMany.class)!=null;
		test |= f.getAnnotation(javax.persistence.Column.class)!=null;
		return test;
	}
	
}
